package com.example.springboot.controller;

import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;


@RestController
@Slf4j
public class UserController {
    @PostMapping("/login")
    public String checkLogin(@RequestBody String username, @RequestBody String password, HttpServletResponse httpServletResponse) throws IOException {
        if (username==null || password == null){
            return "失败";
        }
        httpServletResponse.sendRedirect("/success.html");
        return "成功";
    }

    @GetMapping("/rjjs/{class}")
    public String welcome(@PathVariable("class") String path){

        System.out.println(path);
        return "成功";
    }
    @GetMapping("/rjjs/2221")
    public String welcome(String name,String title){

        System.out.println(name+"==="+title);

        System.out.println("master 演示");




        System.out.println("dev演示");
        return "成功";
    }

}
